package com.ruoyi.system.consumer;

import com.ruoyi.system.utils.EmailUtil;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author : 赵贤
 * @create: 2023-03-15 10:31
 * @Description:
 */
@RocketMQMessageListener(topic = "myTest",consumerGroup = "test-group-bwc")
@Component
public class YkConsumer implements RocketMQListener<String> {

    @Resource
    EmailUtil emailUtil;

    @Override
    public void onMessage(String s) {
        emailUtil.sendEmail(s, "解约成功");
    }

}
